package cn.zxh.improvement.common.core.pipeline.selector;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class DefaultFilterSelectorFactory<T extends FilterSelectorRequest> implements FilterSelectorFactory<T> {

    @Override
    public FilterSelector getFilterSelector(T request) {
        String biz = request.biz();
        List<String> filterNames = SelectorPropertiesConfig.getConfigs().getOrDefault(biz, Collections.unmodifiableList(new ArrayList<>()));
        return new LocalListBasedFilterSelector(filterNames);
    }
}
